@echo off
echo 🎯 集群选举故障测试
echo =====================
echo.

REM 启动3个节点
echo 🚀 启动集群节点...

start "Node-1" cmd /c "cd /d %~dp0\target\release && nacos-server --port 8848 --grpc-port 9090 --node-id node1 --cluster-nodes 127.0.0.1:8848,127.0.0.1:8849,127.0.0.1:8850 > logs\cluster-node1.log 2>&1"
timeout /t 2 /nobreak > NUL

start "Node-2" cmd /c "cd /d %~dp0\target\release && nacos-server --port 8849 --grpc-port 9091 --node-id node2 --cluster-nodes 127.0.0.1:8848,127.0.0.1:8849,127.0.0.1:8850 > logs\cluster-node2.log 2>&1"
timeout /t 2 /nobreak > NUL

start "Node-3" cmd /c "cd /d %~dp0\target\release && nacos-server --port 8850 --grpc-port 9092 --node-id node3 --cluster-nodes 127.0.0.1:8848,127.0.0.1:8849,127.0.0.1:8850 > logs\cluster-node3.log 2>&1"
timeout /t 5 /nobreak > NUL

echo 📊 检查集群状态...
echo.
echo 节点1状态:
curl -s http://localhost:8848/health | find "OK